﻿<UserControl x:Class="DesktopBackground.DesktopBackgroundView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vm="clr-namespace:DesktopBackground"
             mc:Ignorable="d" Height="114" Width="Auto" Margin="8,8,8,0" >
    <UserControl.Resources>
        <vm:DesktopBackgroundViewModel x:Key="desktopBackgroundViewModel" />
    </UserControl.Resources>
    <Grid>
        <CheckBox Content="Remove desktop background" Height="16" HorizontalAlignment="Left" Name="checkBoxRemove" VerticalAlignment="Top" IsChecked="{Binding Path=Model.Remove, Source={StaticResource desktopBackgroundViewModel}}" />
        <CheckBox Content="Replace desktop background" Height="16" HorizontalAlignment="Left" Margin="0,22,0,0" Name="checkBoxReplace" VerticalAlignment="Top"  IsEnabled="True" IsChecked="{Binding Path=Model.Replace, Source={StaticResource desktopBackgroundViewModel}}" />
        <Image Height="69" HorizontalAlignment="Left" Margin="12,44,0,0" Name="imageBackground" VerticalAlignment="Top" Width="107" Stretch="Fill" Source="{Binding Source={StaticResource desktopBackgroundViewModel}, Path=Model.Wallpaper}" />
        <Button Content="Browse..." Height="23" HorizontalAlignment="Left" Margin="125,44,0,0" Name="buttonBrowse" VerticalAlignment="Top" Width="91" Command="{Binding Source={StaticResource desktopBackgroundViewModel}, Path=Browse}" IsEnabled="{Binding Source={StaticResource desktopBackgroundViewModel}, Path=Model.Replace}" />
        <ComboBox Height="23" HorizontalAlignment="Left" Margin="125,73,0,0" Name="comboBoxPosition" VerticalAlignment="Top" Width="91" SelectedIndex="{Binding Source={StaticResource desktopBackgroundViewModel}, Path=Model.Position}" IsEnabled="{Binding Source={StaticResource desktopBackgroundViewModel}, Path=Model.Replace}">
            <ComboBoxItem Content="Center" />
            <ComboBoxItem Content="Tile" />
            <ComboBoxItem Content="Fit to screen" IsSelected="True" />
        </ComboBox>
    </Grid>
</UserControl>
